package ltd.rycloud.tms.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Timestamp;

/***
 * @author     ：RYCloud.ltd ZhangLongBiao
 * @date       ：Created in 2019/6/24 13:03
 * @description：
 * @modified By：
 * @version: $
 *山东如翼云计算科技有限公司  张龙彪  15169994844
 ***/
@Entity
public class Traininfo {
    private int infoId;
    private String title;
    private String content;
    private Integer viewCount;
    private Timestamp createTime;
    private long userId;

    @Id
    @Column(name = "info_id")
    public int getInfoId() {
        return infoId;
    }

    public void setInfoId(int infoId) {
        this.infoId = infoId;
    }

    @Basic
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "content")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "view_count")
    public Integer getViewCount() {
        return viewCount;
    }

    public void setViewCount(Integer viewCount) {
        this.viewCount = viewCount;
    }

    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "user_id")
    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Traininfo traininfo = (Traininfo) o;

        if (infoId != traininfo.infoId) return false;
        if (userId != traininfo.userId) return false;
        if (title != null ? !title.equals(traininfo.title) : traininfo.title != null) return false;
        if (content != null ? !content.equals(traininfo.content) : traininfo.content != null) return false;
        if (viewCount != null ? !viewCount.equals(traininfo.viewCount) : traininfo.viewCount != null) return false;
        if (createTime != null ? !createTime.equals(traininfo.createTime) : traininfo.createTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = infoId;
        result = 31 * result + (title != null ? title.hashCode() : 0);
        result = 31 * result + (content != null ? content.hashCode() : 0);
        result = 31 * result + (viewCount != null ? viewCount.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (int) (userId ^ (userId >>> 32));
        return result;
    }
}
